home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 23.zip
/
BS1 part 23
/
Prof page II type.adf
/
Install
/
UpdateFile
< prev
next >
Wrap
AmigaDOS Script File
|
1990-08-10
|
2KB
|
67 lines
.KEY srcFile/A,srcName,srcVar,destFile/A,destName,destVar,say,ask
.BRA {
.KET }
; Copy a file, but only if the source file's version number is higher
; than that of the destination.
;
; If srcVar is given, it is the name of an environment variable containing
; the source file's version number. If not given, the version number will
; be obtained from srcFile (searching for srcName in the file).
;
; Similarly for destVar.
;
;
; If ASK is given, the user will be asked whether the copy should take place
; (ASK contains the question text).
;
; If SAY is non-blank, it contains a message which will be printed before
; the copy is attempted (this would have been a success/failure indicator
; after the copy, but COPY doesn't return error status, so there's no
; way to test for failure!)
; Get the source and destination version numbers, either from the files
; or from command arguments.
echo >ENV:GDIRC "ok" ; Default status (even if user says "no")
if "{srcVar}" eq ""
instutil -eGDISVer version {srcFile} {srcName}
else
if not "{srcVar}" eq "GDISVer"
copy ENV:{srcVar} ENV:GDISVer
endif
endif
if "{destVar}" eq ""
instutil -eGDIDVer version {destFile} {destName}
else
if not "{destVar}" eq "GDIDVer"
copy ENV:{destVar} ENV:GDIDVer
endif
endif
; if source-version > dest-version
; if !{ask} || ask({say})=='y'
; echo {say}
; copy the file
if not val $GDISVer gt $GDIDVer
skip UpdWrapup
endif
if not "{ask}" eq ""
instutil ask -dy {ask} [Y/N]? Y
if warn
skip UpdWrapup
endif
endif
; Copy the file.
execute GD_SourceDisk:Install/RamCopy {srcFile} {destFile} "{say}" "updated"
lab UpdWrapup